Optimal. Leaf size=54 \[ -\frac {(a-b)^2 \cos (e+f x)}{f}+\frac {2 b (a-b) \sec (e+f x)}{f}+\frac {b^2 \sec ^3(e+f x)}{3 f} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.05, antiderivative size = 54, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.095, Rules used = {3664, 270} \[ -\frac {(a-b)^2 \cos (e+f x)}{f}+\frac {2 b (a-b) \sec (e+f x)}{f}+\frac {b^2 \sec ^3(e+f x)}{3 f} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 270
Rule 3664
Rubi steps
\begin {align*} \int \sin (e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx &=\frac {\operatorname {Subst}\left (\int \frac {\left (a-b+b x^2\right )^2}{x^2} \, dx,x,\sec (e+f x)\right )}{f}\\ &=\frac {\operatorname {Subst}\left (\int \left (2 (a-b) b+\frac {(a-b)^2}{x^2}+b^2 x^2\right ) \, dx,x,\sec (e+f x)\right )}{f}\\ &=-\frac {(a-b)^2 \cos (e+f x)}{f}+\frac {2 (a-b) b \sec (e+f x)}{f}+\frac {b^2 \sec ^3(e+f x)}{3 f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.31, size = 48, normalized size = 0.89 \[ \frac {b \sec (e+f x) \left (6 a+b \sec ^2(e+f x)-6 b\right )-3 (a-b)^2 \cos (e+f x)}{3 f} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.45, size = 59, normalized size = 1.09 \[ -\frac {3 \, {\left (a^{2} - 2 \, a b + b^{2}\right )} \cos \left (f x + e\right )^{4} - 6 \, {\left (a b - b^{2}\right )} \cos \left (f x + e\right )^{2} - b^{2}}{3 \, f \cos \left (f x + e\right )^{3}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 2.13, size = 94, normalized size = 1.74 \[ -\frac {a^{2} f^{3} \cos \left (f x + e\right ) - 2 \, a b f^{3} \cos \left (f x + e\right ) + b^{2} f^{3} \cos \left (f x + e\right )}{f^{4}} + \frac {6 \, a b \cos \left (f x + e\right )^{2} - 6 \, b^{2} \cos \left (f x + e\right )^{2} + b^{2}}{3 \, f \cos \left (f x + e\right )^{3}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.72, size = 125, normalized size = 2.31 \[ \frac {-\cos \left (f x +e \right ) a^{2}+2 a b \left (\frac {\sin ^{4}\left (f x +e \right )}{\cos \left (f x +e \right )}+\left (2+\sin ^{2}\left (f x +e \right )\right ) \cos \left (f x +e \right )\right )+b^{2} \left (\frac {\sin ^{6}\left (f x +e \right )}{3 \cos \left (f x +e \right )^{3}}-\frac {\sin ^{6}\left (f x +e \right )}{\cos \left (f x +e \right )}-\left (\frac {8}{3}+\sin ^{4}\left (f x +e \right )+\frac {4 \left (\sin ^{2}\left (f x +e \right )\right )}{3}\right ) \cos \left (f x +e \right )\right )}{f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.72, size = 71, normalized size = 1.31 \[ \frac {6 \, a b {\left (\frac {1}{\cos \left (f x + e\right )} + \cos \left (f x + e\right )\right )} - b^{2} {\left (\frac {6 \, \cos \left (f x + e\right )^{2} - 1}{\cos \left (f x + e\right )^{3}} + 3 \, \cos \left (f x + e\right )\right )} - 3 \, a^{2} \cos \left (f x + e\right )}{3 \, f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 14.12, size = 126, normalized size = 2.33 \[ -\frac {8\,a\,b+{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^4\,\left (8\,a\,b-6\,a^2\right )+2\,a^2\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^6+{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2\,\left (6\,a^2-16\,a\,b+\frac {32\,b^2}{3}\right )-2\,a^2-\frac {16\,b^2}{3}}{f\,\left ({\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^8-2\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^6+2\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2-1\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (a + b \tan ^{2}{\left (e + f x \right )}\right )^{2} \sin {\left (e + f x \right )}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________